// 这里只负责获得所有商品
import axios from 'axios';
const state = {
    tableState:[]
}
const actions = { //通过上下文的commit触发mutations
    async getGoodsDataActions({ commit }) {
        //异步操作
        const res = await axios({
            url: '/mock/24/getGoodsData',
            method: 'get'
        });
        // console.log(res.data.data)
        commit('addGoodsDatamutations', res.data.data);
        // return res.data.data;
    }
}
const mutations = {
    addGoodsDatamutations(state, data) {
        state.tableState = data
    }
}
const getters = {
    
}


export default {
    state,
    actions,
    mutations,
    getters
}